FROM python:3.9-slim

ADD ./ /

#环境变量
ENV PATH="/root/.local/bin:/usr/local/bin:$PATH"

# 更新 pip
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
# 设置清华源
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
#RUN pip config set global.index-url https://pypi.douban.com/simple/

#RUN apt-get update && apt-get install gcc python3-dev build-essential protobuf-compiler -y

RUN python3 -m pip install --upgrade pip --user && python3 -m pip install --upgrade setuptools && pip3 install importlib_metadata --user
RUN python /setup.py install

RUN echo '#Main start script\n\
\n\
python /dockerps_export/main.py\n\
'\
>> /start.sh && chmod +x /start.sh

CMD [ "/bin/sh", "/start.sh" ]
#CMD ["python","/dockerps_export/main.py"]

